package com.yitong.xjd.domain;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ReturnData4Xjd {
	SimpleDateFormat sf=new SimpleDateFormat("yyyy-MM-dd");
	private String custno;		//核心客户号
	private String status;		//状态码
	private String errormsg;	//错误信息
	private String result;		//额度结果
	private String startdate;
	private String enddate;
	
	public ReturnData4Xjd() {
	}
	
	public ReturnData4Xjd(String custno, String status, String errormsg,String result) {
		this.custno = custno;
		this.status = status;
		this.errormsg = errormsg;
		this.result = result;
		this.startdate="";
		this.enddate="";
	}
	public ReturnData4Xjd(String custno, String status, String errormsg,String result,String startDate) {
		this.custno = custno;
		this.status = status;
		this.errormsg = errormsg;
		this.result = result;
		this.startdate=startDate.replace("-", "");
		Date old=null;
		try {
			old=sf.parse(startDate);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		this.enddate=new SimpleDateFormat("yyyyMMdd").format(old.getTime()+365*24*3600*1000l);
	}
	public String getCustno() {
		return custno;
	}
	public void setCustno(String custno) {
		this.custno = custno;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getErrormsg() {
		return errormsg;
	}
	public void setErrormsg(String errormsg) {
		this.errormsg = errormsg;
	}
	public String getResult() {
		return result;
	}
	public void setResult(String result) {
		this.result = result;
	}
	public String getStartdate() {
		return startdate;
	}

	public void setStartdate(String startdate) {
		this.startdate = startdate;
	}

	public String getEnddate() {
		return enddate;
	}

	public void setEnddate(String enddate) {
		this.enddate = enddate;
	}

	@Override
	public String toString() {
		return "ReturnData4Xjd [sf=" + sf + ", custno=" + custno + ", status="
				+ status + ", errormsg=" + errormsg + ", result=" + result
				+ ", startdate=" + startdate + ", enddate=" + enddate + "]";
	}
	
	
}
